package com.example.friend.controller;

import com.example.common.core.model.R;
import com.example.common.core.model.TableDataInfo;
import com.example.friend.model.question.dto.QuestionQueryDTO;
import com.example.friend.model.question.vo.QuestionDetailVO;
import com.example.friend.model.question.vo.QuestionVO;
import com.example.friend.service.IQuestionService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 功能描述:
 *
 * @author Lenovo
 * @date 2025/4/8
 */
@RestController
@RequestMapping("/question")
public class QuestionController {
    @Resource
    private IQuestionService questionService;

    @GetMapping("/semiLogin/list")
    public TableDataInfo list(QuestionQueryDTO questionQueryDTO) {
        return questionService.list(questionQueryDTO);
    }

    @GetMapping("/detail")
    public R<QuestionDetailVO> detail(Long questionId) {
        return R.ok(questionService.detail(questionId));
    }

    @GetMapping("/preQuestion")
    public R<String> preQuestion(Long questionId) {
        return R.ok(questionService.preQuestion(questionId));
    }

    @GetMapping("/nextQuestion")
    public R<String> nextQuestion(Long questionId) {
        return R.ok(questionService.nextQuestion(questionId));
    }
    
    @GetMapping("/semiLogin/hotList")
    public R<List<QuestionVO>> hotList() {
        return R.ok(questionService.hotList());
    }
}
